import axios from '@/utils/index.js'
// 配置请求的基准URL地址
/**
 * 对评论或评论回复点赞
 */
export function addCommentLike(commentId) {
  return axios({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target: commentId
    }
  })
}

/**
 * 取消对评论或评论回复点赞
 */
export function deleteCommentLike(commentId) {
  return axios({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${commentId}`
  })
}

// 用户 发表 文章评论
export function publishComment(target, content) {
  return axios({
    method: 'POST',
    url: '/v1_0/comments',
    data: {
      target,
      content
    }
  })
}
